home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
dev
/
cross
/
GBDK-2.0.lha
/
GBDK
/
lib
/
asr.s
< prev
next >
Wrap
Text File
|
1998-10-01
|
401b
|
28 lines
.include "global.s"
.area _CODE
;; 16-bit arithmetic shift right
;;
;; Entry conditions
;; BC = value to shift
;; A = number of bits to shift
;;
;; Exit conditions
;; BC = result
;;
;; Register used: AF,BC,DE,HL
.asr16::
OR A ; Test if shift value is 0
RET Z ; If yes, return
1$:
SRA B ; Shift right
RR C
DEC A
JR NZ,1$ ; Finished?
RET
.asr8::
LD B,#0x00
JP .asr16